﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Frames="clr-namespace:Phoenix.Frames"
                    xmlns:Controls="clr-namespace:Phoenix.Controls"
                    xmlns:Controls1="clr-namespace:Transitionals.Controls;assembly=Transitionals">
    <Style TargetType="Frames:PartialView">
        <Setter Property="Background"
                Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Frames:PartialView">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentControl IsHitTestVisible="{TemplateBinding IsContentEnabled}"
                                        Opacity="{Binding ContentOpacity, RelativeSource={RelativeSource TemplatedParent}}"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        VerticalContentAlignment="Stretch">
                            <ContentControl Content="{TemplateBinding Content}" />
                        </ContentControl>

                        <ProgressBar x:Name="PART_ProgressIndicator"
                                     IsIndeterminate="True"
                                     Visibility="Collapsed"
                                     VerticalAlignment="Top"
                                     HorizontalAlignment="Stretch" />
                        <StackPanel HorizontalAlignment="Stretch"
                                    VerticalAlignment="Center"
                                    IsHitTestVisible="False">
                            <Controls:LoadingAnimation Visibility="{TemplateBinding ProgressBarVisibility}"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"
                                                       Width="40"
                                                       Height="40" />
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              Content="{TemplateBinding LoadingMessage}"
                                              Visibility="{TemplateBinding ProgressBarVisibility}" />
                        </StackPanel>

                        <Rectangle Fill="Gray"
                                   Opacity="0.1"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Stretch"
                                   Visibility="{TemplateBinding ProgressBarVisibility}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Frames:TransitionNavigationFrame">
        <Setter Property="Background"
                Value="White" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Frames:TransitionNavigationFrame">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentControl IsHitTestVisible="{TemplateBinding IsContentEnabled}"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        VerticalContentAlignment="Stretch">
                            <ContentControl.Style>
                                <Style TargetType="ContentControl">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContentEnabled, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                     Value="False">
                                            <Setter Property="Opacity"
                                                    Value="0.2" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ContentControl.Style>
                            <Grid HorizontalAlignment="Stretch"
                                  VerticalAlignment="Stretch">
                                <Controls1:TransitionElement x:Name="TransitionElement"
                                                             HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                             VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Grid>
                        </ContentControl>

                        <ProgressBar x:Name="PART_ProgressIndicator"
                                     IsIndeterminate="True"
                                     Visibility="Collapsed"
                                     VerticalAlignment="Top"
                                     HorizontalAlignment="Stretch" />
                        <StackPanel HorizontalAlignment="Stretch"
                                    VerticalAlignment="Center"
                                    IsHitTestVisible="False">
                            <Controls:LoadingAnimation Visibility="{TemplateBinding ProgressBarVisibility}"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"
                                                       Width="40"
                                                       Height="40" />
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              Content="{TemplateBinding LoadingMessage}"
                                              Visibility="{TemplateBinding ProgressBarVisibility}" />
                        </StackPanel>

                        <Rectangle Fill="Gray"
                                   Opacity="0.1"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Stretch"
                                   Visibility="{TemplateBinding ProgressBarVisibility}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Frames:TransitionPartialView">
        <Setter Property="Background"
                Value="White" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Frames:TransitionPartialView">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentControl IsHitTestVisible="{TemplateBinding IsContentEnabled}"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        VerticalContentAlignment="Stretch">
                            <ContentControl.Style>
                                <Style TargetType="ContentControl">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContentEnabled, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                     Value="False">
                                            <Setter Property="Opacity"
                                                    Value="0.2" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ContentControl.Style>
                            <Grid HorizontalAlignment="Stretch"
                                  VerticalAlignment="Stretch">
                                <Controls1:TransitionElement x:Name="TransitionElement"
                                                             HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                             VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Grid>
                        </ContentControl>

                        <ProgressBar x:Name="PART_ProgressIndicator"
                                     IsIndeterminate="True"
                                     Visibility="Collapsed"
                                     VerticalAlignment="Top"
                                     HorizontalAlignment="Stretch" />
                        <StackPanel HorizontalAlignment="Stretch"
                                    VerticalAlignment="Center"
                                    IsHitTestVisible="False">
                            <Controls:LoadingAnimation Visibility="{TemplateBinding ProgressBarVisibility}"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"
                                                       Width="40"
                                                       Height="40" />
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              Content="{TemplateBinding LoadingMessage}"
                                              Visibility="{TemplateBinding ProgressBarVisibility}" />
                        </StackPanel>

                        <Rectangle Fill="Gray"
                                   Opacity="0.1"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Stretch"
                                   Visibility="{TemplateBinding ProgressBarVisibility}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>